#ifndef LAOUTDIALOG_H
#define LAOUTDIALOG_H

#include <QtGui/QMainWindow>
#include "ui_LayoutDialog.h"
#include <vector>
#include <map>
#include <string>

class BaseLayout;
class QFormLayout;
class QTextBrowser;
class QLabel;

class LayoutDialog: public QMainWindow
{
	Q_OBJECT


public:

	static LayoutDialog* getInstance();
	void setupLayoutParameterGUI(std::string json);

public slots:
	void setSelected(int);
	void setupLayoutParameter();	//click ok button
private:
	LayoutDialog(QWidget *parent = 0, Qt::WFlags flags = 0);
	~LayoutDialog();
	void setupLayoutButton(QGridLayout* layout,std::string str);
	void setupLayoutTab();
	void setupDescription(std::string des);
	void clearLayout(QLayout* layout);
	void setStyle();
	void showLayout(QLayout* layout);
	
	BaseLayout* _selectedLayout;
	QLabel* _descriptionArea;
	QHBoxLayout* _applyLayout;
	Ui::LayoutDialogClass ui;
	std::vector<BaseLayout*> _layoutList;
	std::map<std::string,QLineEdit*> _guilist;
	static LayoutDialog * _layoutdialog;
};

#endif